
import axios from "axios";
import request from "../utils/request";
// import request1 from "../utils/request";

export function weather(id) {
    return axios.get('http://wthrcdn.etouch.cn/weather_mini?city=' + id)
}
export function getList(id) {
    return request.get("/cuihe/signin/selectall", { params: id })
}
export function getFollow(id) {
    return request.get("/cuihe/collect/selectallcollect/3", { params: id })
}
export function delFollow(userid, dataid) {
    return request.get("/cuihe/collect/delcollect/3", { params: userid, dataid })
}
export function addFollow(userid, dataid) {
    return request.get("/cuihe/collect/addcollect/3", { params: userid, dataid })
}


export function getSkills(id) {
    return request.get("/cuihe/collect/selectallcollect/1", { params: id })
}
export function delSkills(userid, dataid) {
    return request.get("/cuihe/collect/delcollect/1", { params: userid, dataid })
}
export function addSkills(userid, dataid) {
    return request.get("/cuihe/collect/addcollect/1", { params: userid, dataid })
}



export function getClock(id) {
    return request.get("/cuihe/signin/add", { params: id })
}
export function getDiscount(id) {
    return request.get("/cuihe/coupon/selectallcoupon", { params: id })
}
// -----------------------------


// --------   sjjjjjjjj      -------------------
// 注册
export function login(data) {
    return request.post('/junjian/user/regist', data)
}
// 验证码
export function message(data) {
    return request.post('/junjian/user/loginByCode', data)
}
// 登录 密码登录
export function message1(data) {
    return request.post('/junjian/user/login', data)
}
// /user/getCode
export function getCode(params) {
    return request.get('/junjian/user/getCode',{params})
}
// 登录 密码登录
export function message2(data) {
    return request.post('/junjian/user/loginByCode', data)
}
// 用户个人资料
export function userInfo(data) {
    return request.post('/junjian/user/userInfo', data)
}
// 获取视频标签
export function getkinds(params) {
    return request.get('/junjian/video/getkinds', { params })
}
// 获取视频列表 需要传 kind
export function getvideo(params) {
    return request.get('/junjian/video/getvideo', { params })
}
// 展示用户头像的接口
export function showimg(params) {
    return request.get('/junjian/user/showimg', {params})
}
// /pay/showPay
// 展示消费记录
export function showPay(data) {
    return request.post('/junjian/pay/showPay', data)
}
// /pay/showTop
// 展示充值
export function showTop(data) {
    return request.post('/junjian/pay/showTop', data)
}
// /pay/addPay 购买部分
export function DfaddPay(data){
    return request.post('/junjian/pay/addPay',data)
} 
export function Edituser(data){
    return request.post('/junjian/user/updateUser',data)
} 

// ---------  chhhhhhh    ------------------
// 分类与订单  
export function myorder(params) {
    return request.get('/cuihe/order/select', { params })
}
// 删除订单 先删除后调取信息
export function update(params) {
    return request.get('/cuihe/order/update', { params })
}
// 全部分类
export function menuall() {
    return request.get('/cuihe/menu/menuall')
}
// 点击量加1
export function menuclick(params) {
    return request.get('/cuihe/menu/menuclick',{params})
}

// 删除订单接口
// export function delorder(params) {
//     return request.get('/cuihe/order/del', { params })
// }
// --------------------------------



//模糊查询
export function Search(val){
    return request.get('/cuihe/search/select',{params:val})
   
} 

//首页轮播
export function Banner() {
    return request.get('/yonghao/index/indeximg')
}

//快讯轮播
export function Kuaixun() {
    return request.get('/yonghao/index/titles')
}

//热门课程轮播
export function Holebanner() {
    return request.get('/yonghao/index/hotcourses')
}

//即将开课
export function AfterLes() {
    return request.get('/yonghao/index/comingcourses/')
}

//快讯详情
export function KuaixunDetail(id) {
    return request.get(`/yonghao/index/news?newsId=${id}`)
}

//课程详情
export function LesDeta(id) {
    return request.get(`/yonghao/index/course?courseId=${id}`)
}

//课程列表
export function LesList(data) {
    return request.post('/yonghao/index/kindcourses',data)
}

//获取课程评论
export function getPing(id) {
    return request.get(`/yonghao/comment/showcomment?courseId=${id}`)
}


//支付二维码
export function getUrl(id){
    return request.get(`/yonghao/pay/uptop?uId=${id}`)
}

//获取支付状态
export function getStatus(id) {
    return request.get(`/yonghao/pay/status?uId=${id}`)
}

//添加充值记录
export function addChong(data) {
    return request.post('/junjian/pay/addTop',data)
}

//详情购买
export function detailBuy(params) {
    return request.get('/cuihe/order/add1',{params})
}

//详情支付
export function detaPay(data) {
    console.log(data,"ddddd")
    return request.post('/junjian/pay/addPay',data)
}

//详情加入购物车
export function detaAdd(params) {
    console.log(params,"ppppppppppp")
    return request.get('/cuihe/order/add',{params})
}

//评论点赞
export function ClickLike(params) {
    return request.get('/yonghao/comment/commentLike',{params})
}

//课程点赞
export function CourLike(params) {
    return request.get('/yonghao/course/like',{params})
}

//点赞状态
export function LikeStatus(params) {
    return request.get('/yonghao/course/showlike',{params})
}